<%--
  Created by IntelliJ IDEA.
  User: xi
  Date: 2015/10/18
  Time: 9:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>

  <meta charset="utf-8" />
  <title></title>
  <link rel="stylesheet" type="text/css" href="../css/BSindex.css"/>
  <link rel="stylesheet" type="text/css" href="../css/main.css"/>
  <script src="../js/BSindex.js" type="text/javascript" charset="utf-8"></script>
  <script type="text/javascript"  src="/fruits/js/jq.js"></script>
  <c:if test="${sessionScope.fruitsInfo==null}">
    <script type="text/javascript">
      $(function () {
        location.href="/fruits/GetAllFruitsServlet?pageNum=1" ;
      });
    </script>
  </c:if>
</head>
<body >
<div class="mean">
  <div class="logo">
    <a href="index.jsp"><img src="/fruits/img/alogo.png" alt="" /></a>
  </div>

  <jsp:include page="menu.jsp"></jsp:include>

</div>


<div class="gong" id="x4">
  <div class="con">
    <div class="tit">
      <ul>
        <li>水果</li>
        <li class="i">&nbsp;</li>
        <li>规格</li>
        <li class="i">&nbsp;</li>
        <li>单价</li>
        <li class="i">&nbsp;</li>
        <li>操作</li>
      </ul>
    </div>
    <c:forEach items="${sessionScope.fruitsInfo.list}" var="fruit">
      <div class="info">
        <ul>
          <li><a href="/fruits/UpdateFruitServlet?fid=${fruit.fid}">${fruit.fname}</a></li>
          <li class="i">&nbsp;</li>
          <li><a href="/fruits/UpdateFruitServlet?fid=${fruit.fid}">${fruit.fnorm}</a></li>
          <li class="i">&nbsp;</li>
          <li><a href="/fruits/UpdateFruitServlet?fid=${fruit.fid}">${fruit.fprice}</a></li>
          <li class="i">&nbsp;</li>
          <li><a href="/fruits/DeleteFruitServlet?fid=${fruit.fid}">删除</a></li>
        </ul>
      </div>
    </c:forEach>
    <c:choose>
      <c:when test="${sessionScope.isHot}">
        <c:if test="${fruitsInfo.hasPreviousPage}">
          <a href="/fruits/AdminGetHotFruitsServlet?pageNum=${fruitsInfo.pageNum-1}">上一页</a>
        </c:if>
        <c:if test="${fruitsInfo.hasNextPage}">
          <a href="/fruits/AdminGetHotFruitsServlet?pageNum=${fruitsInfo.pageNum+1}">下一页</a>
        </c:if>
      </c:when>
      <c:otherwise>
        <c:if test="${fruitsInfo.hasPreviousPage}">
          <a href="/fruits/GetAllFruitsServlet?pageNum=${fruitsInfo.pageNum-1}">上一页</a>
        </c:if>
        <c:if test="${fruitsInfo.hasNextPage}">
          <a href="/fruits/GetAllFruitsServlet?pageNum=${fruitsInfo.pageNum+1}">下一页</a>
        </c:if>
      </c:otherwise>
    </c:choose>
  </div>
</div>



</body>
</html>

